package cc.ufinity.networkdiagnose.manager;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import android.net.wifi.ScanResult;
import android.telephony.NeighboringCellInfo;
import cc.ufinity.networkdiagnose.util.StringUtils;

public final class Task implements Serializable {
    public final static String TASK_TYPE_Y="验收测试";
    private static final long serialVersionUID = 1L;
    public final static String TAG_PING_ADDRESS = "PingAddress";
    public final static String TAG_HTTP_ADDRESS = "HttpSite";
    public final static String TAG_FTP_ADDRESS = "FTPAddress";
    public ScanResult scanResult;
    public List<NeighboringCellInfo> neighborInfos = new ArrayList<NeighboringCellInfo>();
    public String id = "";
    public String acIp = "";
    public static List<String> testedAp = new ArrayList<String>();
    public int selNetType ; 
    public int testApCount = 0;
    public String netType = "";
    public String netType2 = "";
    public String testPhone = "";
    public String taskMan = "";
    public String taskPhone = "";
    public String taskName = "";
    public String taskType = "";
    /**
     * 1:网络测试   2:任务测试   3:验收测试
     */
    public int testType = 1;  //1:网络测试   2:任务测试   3:验收测试
    public int testedNum = 0;
    public String taskDes = "0";
    public String taskAddress = "0";
    public String city = "合肥";
    public String town = "合肥";
    /**
     * 通信运营商
     */
    public String carrier = "0";
    public String apName = "0";
    public String mac = "0";
    public String lac = "0";
    public String ci = "0";
    public String longitute = "0";
    public String latitute = "0";
    public String startTime = "0";
    public String endTime = "0";
    public String startsTime = "0";
    public String endsTime = "0";
    
    public String relevanceAPAvgTime = "0";
    public String relevanceAPSuccessRate = "0";
    public String apTestCount = "0";
    public String apTestSuccessCount = "0";
    
    public String rssi = "0";
    public String snr = "0";
    public String webDelay = "0";
    
    public String webLoginCount = "0";
    public String webLoginSuccessCount = "0";
    public String webOutCount = "0";
    public String webOutSuccessCount = "0";
    public String testFlag = "0";
    public String webSuccessRate = "0";
    public String webOffSuccessRate = "0";
    
    public String peapDelay = "0";
    public String peapAuthAvgTime = "0";
    public String peapSuccessRate = "0";
    public String peapOffSuccessRate = "0";
    public String peapCount = "0";
    public String peapSuccessCount = "0";
    public String peapOffCount = "0";
    public String peapOffSuccessCount = "0";
    
    public String httpAnwerDelay = "0";
    public String httpCallCount = "0";
    public String httpCallSuccessCount = "0";
    public String httpCallSuccessRate = "0";
    
    public String pingAvgDelay = "0";
    public String pingCount = "0";
    public String pingSuccessCount = "0";
    public String ftpUpCount = "0";
    public String ftpUpSuccessCount = "0";
    public String ftpDownCount = "0";
    public String ftpDownSuccessCount = "0";
    public String ftpDownAvgSuccessRate = "0";
    public String ftpUpAvgSuccessRate = "0";
    
    public String userIsolateCount = "0";
    public String userIsolateSuccessCount = "0";
    public String userIsolateSuccessRate = "0";
    
    public String userRoamCount = "0";
    public String userRoamSuccessCount = "0";
    public String userRoamSuccessRate = "0";
    
    public String simAuthSuccessRate = "0";
    public String SimAuthAvgTime = "0";
    public GPS gps;
    public TD td;
    public Wlan wlan;
    public GSM gsm;
    public List<FTPTask> ftpTasks;
    public List<PingTask> pingTasks;
    public List<HttpTask> httpTasks;
    public List<Map<String,String[]>> apList;
    public ApRelevTask apTask;
    public int testTaskCount = 0;
    public int testCount = 5;
    public int testAllCount = 0;
    public String remark = "";
    

    // public List<SubTask> subTask;

    public FTPTask newFTPTask(String ftpAddress) {
        return new FTPTask(ftpAddress);
    }

    public HttpTask newHttpTask(String address) {
        return new HttpTask(address);
    }

    public PingTask newPingTask(String address) {
        return new PingTask(address);
    }

    public ApRelevTask newApRelevTask() {
        return new ApRelevTask();
    }

    public GPS newGPS() {
        return new GPS();
    }

    public TD newTD() {
        return new TD();
    }

    public Wlan newWlan() {
        return new Wlan();
    }

    public GSM newGSM() {
        return new GSM();
    }

    public class GSM {
        public String netType;
        public String lac;
        public String ci;
        public String fieldstrength;
        public String rssi;
        public String ber;
    }

    public class TD {
        public String netType;
        public String lac;
        public String ci;
        public String fieldstrength;
        public String rssi;
        public String ber;
    }

    public class Wlan {
        public String netType = "";
        public String apSource = "";
        public String ssid = "";
        public String bssid = "";
        public String cap = "";
        public String freq = "";
        public String fieldstrength = "";
        public String apSignal = "";
        public String radioSignal = "";
        public String Samefrequency = "";
    }

    public class GPS {
        public String Longitute;
        public String Latitute;
        public String LAC;
        public String Ci;
    }

    public class FTPTask {

        public String address;
        public String user;
        public String pwd;
        public long loginTime;
        public String upRate;
        public String downRate;

        public FTPTask(String ftpAddress) {
            if (!StringUtils.isEmpty(ftpAddress)) {
                String[] s = ftpAddress.split(",");
                address = s[0];
                user = s[1];
                pwd = s[2];
            }
        }
    }

    public class PingTask {
        public String bytes;
        public String time;
        public String ttl;
        public String count;
        public String successCount;

        public PingTask(String address) {
            this.address = address;
        }

        public String address;
    }

    public class HttpTask {
        public String delay;
        public String speed;
        public String address;
        public int failedTimes;

        public HttpTask(String address) {
            this.address = address;
        }
    }

    public class ApRelevTask {
        public ScanResult scanResult;
        public long delay;
        // public long speed;
    }

	 
}
